#ifndef _VIC_H_
#define _VIC_H_

#define VIC_VECT_CNTL_ENABLE_MASK 0x20
#define VIC_VECT_CNTL_SOURCE_MASK 0x1f

typedef struct __vic {
  unsigned int const volatile irq_status;
  unsigned int const volatile fiq_status;
  unsigned int const volatile raw_intr;
  unsigned int volatile int_select;
  unsigned int volatile int_enable;
  unsigned int volatile int_en_clear;
  unsigned int volatile soft_int;
  unsigned int volatile soft_int_clear;
  unsigned int volatile protection;

  // unused space - DO NOT WRITE
  unsigned char volatile const unused0[0xc];

  unsigned int volatile vect_addr;
  unsigned int volatile def_vect_addr;
  
  // unused space - DO NOT WRITE
  unsigned char volatile const unused1[0xc8];
  
  unsigned int volatile vect_addr0;
  unsigned int volatile vect_addr1;
  unsigned int volatile vect_addr2;
  unsigned int volatile vect_addr3;
  unsigned int volatile vect_addr4;
  unsigned int volatile vect_addr5;
  unsigned int volatile vect_addr6;
  unsigned int volatile vect_addr7;
  unsigned int volatile vect_addr8;
  unsigned int volatile vect_addr9;
  unsigned int volatile vect_addr10;
  unsigned int volatile vect_addr11;
  unsigned int volatile vect_addr12;
  unsigned int volatile vect_addr13;
  unsigned int volatile vect_addr14;
  unsigned int volatile vect_addr15;
  
  // unused space - DO NOT WRITE
  unsigned char volatile const unused2[0xc0];
  
  unsigned int volatile vect_cntl0;
  unsigned int volatile vect_cntl1;
  unsigned int volatile vect_cntl2;
  unsigned int volatile vect_cntl3;
  unsigned int volatile vect_cntl4;
  unsigned int volatile vect_cntl5;
  unsigned int volatile vect_cntl6;
  unsigned int volatile vect_cntl7;
  unsigned int volatile vect_cntl8;
  unsigned int volatile vect_cntl9;
  unsigned int volatile vect_cntl10;
  unsigned int volatile vect_cntl11;
  unsigned int volatile vect_cntl12;
  unsigned int volatile vect_cntl13;
  unsigned int volatile vect_cntl14;
  unsigned int volatile vect_cntl15;

  // unused space - DO NOT WRITE
  unsigned char volatile const unused3[0xda0];

  unsigned int volatile const periph_id0;
  unsigned int volatile const periph_id1;
  unsigned int volatile const periph_id2;
  unsigned int volatile const periph_id3;
} vic;

#endif
